//
//  UIBarButtonitem+Extensions.swift
//  TSYWeiBoDemo
//
//  Created by apple on 2016/11/24.
//  Copyright © 2016年 apple. All rights reserved.
//

import UIKit


extension UIBarButtonItem{
    
    
    convenience init(title:String,fontSize:CGFloat=16,target:AnyObject?,action:Selector,isBack:Bool=false) {
        
        let btn:UIButton = UIButton()
        
        btn.setTitle(title, for: UIControlState.normal)
        
        btn.titleLabel?.font = UIFont.systemFont(ofSize: fontSize)
        
        btn.addTarget(target, action: action, for: UIControlEvents.touchUpInside)
        
        if isBack {
            //是返回按钮的话
        }
        
        self.init(customView:btn)
        
    }
    
    
    
    
    
}
